/**
 * 
 */
package com.oron3.bouncer.genericgl;

import javax.microedition.khronos.opengles.GL10;

import android.graphics.Paint;

/**
 * @author Ofek
 *
 */
public class GLText {
	private final LabelMaker labelMaker;
	private final Paint mLabelPaint;
	private int w;
	private int h;


	/**
	 * 
	 */
	public GLText(final LabelMaker labelMaker) {
		this.labelMaker = labelMaker;
		mLabelPaint = new Paint();
		mLabelPaint.setTextSize(32);
		mLabelPaint.setAntiAlias(true);
		mLabelPaint.setARGB(0xff, 0x00, 0x00, 0x00);

	}
	public void init(final GL10 gl,final int w,final int h) {
		labelMaker.initialize(gl);
		labelMaker.beginAdding(gl);
		labelMaker.add(gl, "x", mLabelPaint);
		labelMaker.add(gl, "y", mLabelPaint);
		labelMaker.add(gl, "z", mLabelPaint);
		labelMaker.endAdding(gl);
		this.w = w;
		this.h = h;
	}

	public void draw(final GL10 gl,final String s) {
		labelMaker.beginDrawing(gl, w, h);
		//		for (final char c : s.toCharArray()  ) {
		//			labelMaker.draw(gl, tx, ty, c);
		//		}

		labelMaker.endDrawing(gl);
	}

}
